package cn.ilikes.modules.likes.dbs;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import cn.ilikes.modules.HbaseIndex;
import cn.ilikes.tools.hbase.jpa.annotations.IndexColumn;
import cn.ilikes.tools.hbase.jpa.annotations.IndexColumn.Index;
import cn.ilikes.tools.hbase.jpa.annotations.Save;

@Entity
@Table(name = "ilikes_content", schema = HbaseIndex.ILIKES_SCHEMA)
@cn.ilikes.tools.hbase.jpa.annotations.Index
public class IlikesContent {

	@Id
	private String uuid;

	@Column(name = "content@title")
	@IndexColumn(index = Index.analyzed)
	private String title;

	@Column(name = "content@content")
	private String html;

	@Column(name = "content@url")
	@IndexColumn(index = Index.analyzed)
	private String url;
	
	@Column(name = "itmp@content")
	@IndexColumn(index = Index.analyzed)
          @Save(save=false)
	private String content;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "content@folderId")
	@IndexColumn
	private IlikesFolder likesFolder;

	@ManyToOne
	@JoinColumn(name = "user@login_name")
	@IndexColumn
	private IlikesUser likesUser;

	public String getUuid() {
		return uuid;
	}

	public String getTitle() {
		return title;
	}

	public String getContent() {
		return content;
	}

	public String getUrl() {
		return url;
	}

	public IlikesFolder getLikesFolder() {
		return likesFolder;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public void setLikesFolder(IlikesFolder likesFolder) {
		this.likesFolder = likesFolder;
	}

	public IlikesUser getLikesUser() {
		return likesUser;
	}

	public void setLikesUser(IlikesUser likesUser) {
		this.likesUser = likesUser;
	}

	public String getHtml() {
		return html;
	}

	public void setHtml(String html) {
		this.html = html;
	}

}
